﻿using Idte.Application.Core.Actor;
using Idte.Application.Core.Navigation;
using Idte.Core.Infrastructure.Repository;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Idte.Application.Core
{
    /// <summary>
    /// Apply Factory Builder pattern to build the concrete 
    /// </summary>

    public abstract class ApplicationModel : IApplicationModel
    {

        //MenuConfiguration menuConfig = ConfigurationManager.GetSection("MenuSection") as MenuConfiguration;
        public ApplicationModel()
        {
            Contexts = new List<AppContext>();
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid Id { get; set; }
        public string Title { get; set; }


        //[ForeignKey("AppModelId")]
        //public virtual ICollection<UserAppRole> Users { get; set; }

        public virtual ICollection<AppRole> Actors { get; set; }

        [InverseProperty("AppModel")]
        public virtual ICollection<AppContext> Contexts { get; set; }

        public abstract ICollection<Menu> ContextNavigation { get; }

        public abstract ICollection<Menu> EntityNavigation { get; }

    }
}
